Clarify reasons for async exclude
authorFelix Krull <f_krull@gmx.de>
Tue, 21 May 2019 17:57:30 +0000 (19:57 +0200)
committerColin Walters <walters@verbum.org>
Fri, 6 May 2022 16:53:53 +0000 (12:53 -0400)
rust-bindings/rust/conf/ostree.toml
rust-bindings/rust/src/auto/repo.rs

index f8636fe0834b4d738751962dcaf1bce4295fec9c..21ec029f200fbcb233c8133656e6c8e2ec4f3f89 100644 (file)
@@ -81,13 +81,13 @@ status = "generate"
 name = "OSTree.Repo"
 status = "generate"
     [[object.function]]
-    # not sure what's wrong with this method; might be a gir issue
+    # crashes while generating, not sure what's wrong with this; might be a gir issue
     name = "write_metadata_async"
     ignore = true
 
     [[object.function]]
-    # async generates bad code (for now?); revisit with newer gir
-    pattern = ".+_async"
+    # issue with the return type of content (thinks guchar** is u8)
+    name = "write_content_async"
     ignore = true
 
 [[object]]
index dfe9f3e485e7536b618f5c767365df31533ece1a..7a6f96caa0d1b5954156e53e12f0636236ed50d6 100644 (file)
@@ -163,6 +163,39 @@ impl Repo {
     //    unsafe { TODO: call ostree_sys:ostree_repo_export_tree_to_archive() }
     //}
 
+    //#[cfg(any(feature = "v2018_6", feature = "dox"))]
+    //pub fn find_remotes_async<P: IsA<AsyncProgress>, Q: IsA<gio::Cancellable>, R: FnOnce(Result</*Ignored*/Vec<RepoFinderResult>, Error>) + Send + 'static>(&self, refs: &[&CollectionRef], options: Option<&glib::Variant>, finders: /*Ignored*/&[RepoFinder], progress: Option<&P>, cancellable: Option<&Q>, callback: R) {
+    //    unsafe { TODO: call ostree_sys:ostree_repo_find_remotes_async() }
+    //}
+
+    //#[cfg(feature = "futures")]
+    //#[cfg(any(feature = "v2018_6", feature = "dox"))]
+    //pub fn find_remotes_async_future<P: IsA<AsyncProgress> + Clone + 'static>(&self, refs: &[&CollectionRef], options: Option<&glib::Variant>, finders: /*Ignored*/&[RepoFinder], progress: Option<&P>) -> Box_<future::Future<Output = Result</*Ignored*/Vec<RepoFinderResult>, Error>> + std::marker::Unpin> {
+        //use gio::GioFuture;
+        //use fragile::Fragile;
+
+        //let refs = refs.clone();
+        //let options = options.map(ToOwned::to_owned);
+        //let finders = finders.clone();
+        //let progress = progress.map(ToOwned::to_owned);
+        //GioFuture::new(self, move |obj, send| {
+        //    let cancellable = gio::Cancellable::new();
+        //    let send = Fragile::new(send);
+        //    obj.find_remotes_async(
+        //        &refs,
+        //        options.as_ref().map(::std::borrow::Borrow::borrow),
+        //        &finders,
+        //        progress.as_ref().map(::std::borrow::Borrow::borrow),
+        //        Some(&cancellable),
+        //        move |res| {
+        //            let _ = send.into_inner().send(res);
+        //        },
+        //    );
+
+        //    cancellable
+        //})
+    //}
+
     #[cfg(any(feature = "v2017_15", feature = "dox"))]
     pub fn fsck_object<P: IsA<gio::Cancellable>>(&self, objtype: ObjectType, sha256: &str, cancellable: Option<&P>) -> Result<(), Error> {
         unsafe {
@@ -464,6 +497,37 @@ impl Repo {
         }
     }
 
+    //#[cfg(any(feature = "v2018_6", feature = "dox"))]
+    //pub fn pull_from_remotes_async<P: IsA<AsyncProgress>, Q: IsA<gio::Cancellable>, R: FnOnce(Result<(), Error>) + Send + 'static>(&self, results: /*Ignored*/&[&RepoFinderResult], options: Option<&glib::Variant>, progress: Option<&P>, cancellable: Option<&Q>, callback: R) {
+    //    unsafe { TODO: call ostree_sys:ostree_repo_pull_from_remotes_async() }
+    //}
+
+    //#[cfg(feature = "futures")]
+    //#[cfg(any(feature = "v2018_6", feature = "dox"))]
+    //pub fn pull_from_remotes_async_future<P: IsA<AsyncProgress> + Clone + 'static>(&self, results: /*Ignored*/&[&RepoFinderResult], options: Option<&glib::Variant>, progress: Option<&P>) -> Box_<future::Future<Output = Result<(), Error>> + std::marker::Unpin> {
+        //use gio::GioFuture;
+        //use fragile::Fragile;
+
+        //let results = results.clone();
+        //let options = options.map(ToOwned::to_owned);
+        //let progress = progress.map(ToOwned::to_owned);
+        //GioFuture::new(self, move |obj, send| {
+        //    let cancellable = gio::Cancellable::new();
+        //    let send = Fragile::new(send);
+        //    obj.pull_from_remotes_async(
+        //        &results,
+        //        options.as_ref().map(::std::borrow::Borrow::borrow),
+        //        progress.as_ref().map(::std::borrow::Borrow::borrow),
+        //        Some(&cancellable),
+        //        move |res| {
+        //            let _ = send.into_inner().send(res);
+        //        },
+        //    );
+
+        //    cancellable
+        //})
+    //}
+
     pub fn pull_one_dir<P: IsA<AsyncProgress>, Q: IsA<gio::Cancellable>>(&self, remote_name: &str, dir_to_pull: &str, refs_to_fetch: &[&str], flags: RepoPullFlags, progress: Option<&P>, cancellable: Option<&Q>) -> Result<(), Error> {
         unsafe {
             let mut error = ptr::null_mut();